from typing import List


def canThreePartsEqualSum(arr: List[int]) -> bool:
    s = sum(arr)
    if s % 3 !=0:
        return False
    target = s //3
    n,i,cur = len(arr),0,0
    while i < n :
        cur += arr[i]
        if cur == target:
            break
        i+=1
    if cur != target:
        return False
    j = i+1
    while j < n-1 :
        cur += arr[j]
        if cur == 2 * target:
            return True
        j+=1
    return False
    
    
            
    